﻿@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>@ViewBag.Title</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="~/Styles/demo.css" />
    <script src="~/scripts/boot.js" type="text/javascript"></script>
</head>
<body style="overflow-y: scroll;">
    <form id="form1" method="post">
    <input name="Id" class="mini-hidden" value="@Model.Id" />
    <div style="padding-left: 11px; padding-bottom: 5px;" id="printArea">
        @RenderBody()
    </div>
    <div style="text-align: center; padding: 0 10px 10px 10px;">
        <a class="mini-button" onclick="onOk" style="width: 60px; margin-right: 20px;">打印</a>
        <a class="mini-button" onclick="onCancel" style="width: 60px;">关闭</a>
    </div>
    </form>
    <script type="text/javascript">
        var entityId = "@Model.Id";
        mini.parse();

        var form = new mini.Form("form1");

        function GetData() {
            var o = form.getData();
            return o;
        }
        function CloseWindow(action) {
            if (action == "close" && form.isChanged()) {
                if (confirm("数据被修改了，是否先保存？")) {
                    return false;
                }
            }
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();
        }
        function onOk(e) {
            //$(".mini-grid-border").removeClass("mini-grid-border").addClass("mini-grid-border_tmp");
            //$("td").removeProp("style");
            $(".mini-grid-body").css("overflow", "hidden");
            $("#qr").show();
            $(".mini-grid-cell").css("font-size", "13px")
            var height = $(".mini-grid-body").first().height();
            $(".mini-grid-body").css("height", $(".mini-grid-body tr").size() * 23);
            $("#printArea").printArea();
            $(".mini-grid-body").css("height",height);
            //$(".mini-grid-border_tmp").removeClass("mini-grid-border_tmp").addClass("mini-grid-border");
            $("#qr").hide();
            $(".mini-grid-cell").css("font-size", "9pt")
        }
        function onCancel(e) {
            CloseWindow("cancel");
        }

    </script>
    @RenderSection("script", required: false)
</body>
</html>
